﻿<navigation:Page x:Class="WebRSSBuilder.Views.ManageRoles" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
          xmlns:datacontrols="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           Title="ManageRoles Page" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" xmlns:my="clr-namespace:WebRSSBuilder.Web" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" Height="482" Width="642">
    <UserControl.Resources>
        <riaControls:DomainDataSource x:Key="RoleSource" AutoLoad="True" d:DesignData="{d:DesignInstance my:aspnet_Roles, CreateList=true}" Height="0" LoadedData="aspnet_RolesDomainDataSource_LoadedData" Name="aspnet_RolesDomainDataSource" QueryName="GetAspnet_RolesQuery" Width="0">
            <riaControls:DomainDataSource.DomainContext>
                <my:DomainServiceDB />
            </riaControls:DomainDataSource.DomainContext>
        </riaControls:DomainDataSource>
    </UserControl.Resources>

        <Grid x:Name="LayoutRoot">
        
        <sdk:DataGrid AutoGenerateColumns="False" IsReadOnly="True" Height="100" HorizontalAlignment="Left" ItemsSource="{Binding Source={StaticResource RoleSource}, Path=Data}" Margin="136,48,0,0" Name="aspnet_RolesDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" Width="400">
            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn x:Name="roleNameColumn" Binding="{Binding Path=RoleName}" Header="Role Name" Width="SizeToHeader" />
                <sdk:DataGridTextColumn x:Name="descriptionColumn" Binding="{Binding Path=Description}" Header="Description" Width="SizeToHeader" />
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>
        <datacontrols:DataForm Name="Dataform1" Width="400" Height="200" ItemsSource="{Binding Source={StaticResource RoleSource}, Path=Data}" AutoEdit="False" Margin="136,155,104,125">
            <StackPanel>
                <datacontrols:DataField>
                    <TextBox  Height="23" HorizontalAlignment="Left" Margin="3" Name="RoleNameField" Text="{Binding Path=RoleName, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" />
                </datacontrols:DataField>
                <datacontrols:DataField>
                    <TextBox Height="23" HorizontalAlignment="Left" Margin="3" Name="RoleDescriptionField" Text="{Binding Path=Description, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" />
                </datacontrols:DataField>
                <datacontrols:DataField>
                    <TextBox Height="23" HorizontalAlignment="Left" Margin="3" Name="lowerdRoleNameField" Text="{Binding Path=LoweredRoleName, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" />
                </datacontrols:DataField>

            </StackPanel>
        </datacontrols:DataForm>
        <Button Content="Save" Height="23" HorizontalAlignment="Left" Margin="180,12,0,0" Name="button1" VerticalAlignment="Top" Width="75" Command="{Binding Source={StaticResource RoleSource}, Path=SubmitChangesCommand}" />
        <Button Content="Cancel" Height="23" HorizontalAlignment="Left" Margin="435,12,0,0" Name="button2" VerticalAlignment="Top" Width="75" Command="{Binding Source={StaticResource RoleSource}, Path=RejectChangesCommand}" />
    </Grid>
    
</navigation:Page>
